﻿using System;
using UnityEngine;

// Token: 0x0200036C RID: 876
public class GameScreenShotAssist : MonoBehaviour
{
	// Token: 0x17000227 RID: 551
	// (get) Token: 0x060015E3 RID: 5603 RVA: 0x000937F0 File Offset: 0x000919F0
	// (set) Token: 0x060015E4 RID: 5604 RVA: 0x000937F8 File Offset: 0x000919F8
	public RenderTexture rtCamera { get; private set; }

	// Token: 0x060015E5 RID: 5605 RVA: 0x00093804 File Offset: 0x00091A04
	private void Start()
	{
		this.rtCamera = new RenderTexture(Screen.width, Screen.height, 24, RenderTextureFormat.ARGB32, RenderTextureReadWrite.Default);
	}

	// Token: 0x060015E6 RID: 5606 RVA: 0x00093820 File Offset: 0x00091A20
	private void OnRenderImage(RenderTexture src, RenderTexture dst)
	{
		if (this.material != null)
		{
			if (this.rtCamera != null)
			{
				Graphics.Blit(src, this.rtCamera, this.material);
			}
			Graphics.Blit(src, dst);
		}
		else if (this.rtCamera == null)
		{
			Graphics.Blit(src, dst);
		}
		else
		{
			Graphics.Blit(src, this.rtCamera);
			Graphics.Blit(src, dst);
		}
	}

	// Token: 0x060015E7 RID: 5607 RVA: 0x000938A0 File Offset: 0x00091AA0
	private void OnDestroy()
	{
		if (this.rtCamera)
		{
			this.rtCamera.Release();
			this.rtCamera = null;
		}
	}

	// Token: 0x040019D4 RID: 6612
	[SerializeField]
	private Material material;
}
